package com.zjuee.base.bean.response;

/**
 * 基础通用的错误代码
 *
 * @author wu liang
 * @since 1.0
 */
public enum CommonResultCode implements ResultCode{

    //成功  通用
    OK("00000", "success"),

    //用户端
    //一级宏观错误码
    CONSUMER_ERR("A0001", "用户端异常"),
    //二级宏观错误
    USER_REGISTER_ERR("A0100", "用户注册错误"),
    USER_LOGIN_EXP("A0200", "用户登陆异常"),
    AUTH_EXP("A0300", "访问权限异常"),
    CONSUMER_REQ_PARAM_ERR("A0400", "用户请求参数错误"),
    CONSUMER_REQ_SERVER_EXP("A0500", "用户请求服务异常"),
    CONSUMER_RESOURCE_EXP("A0600", "用户资源异常"),
    CONSUMER_FILE_EXP("A0700", "用户上传文件异常"),
    CONSUMER_CUR_VERSION_ERR8("A0800", "用户当前版本异常"),
    CONSUMER_PRIVACY_LACK_AUTH("A0900", "用户隐私未授权"),
    CONSUMER_DEVICE_EXP("A1000", "用户设备异常"),
    //三级宏观错误
    ACCOUNT_ERR("A0201","用户账号不存在"),
    PW_ERR("A0210","用户密码错误"),
    CAPTCHA_ERR("A0240","验证码错误"),
    UN_AUTH("A0202","未登录"),
    LOGIN_DISABLED("A0220","用户被禁用"),

    // shiro角色校验失败
    UN_HAS_ROLES("A0301","无此权限"),
    // shiro权限校验失败
    UN_HAS_PERMS("A0302","无此权限"),



    ILLEGAL_INPUT("A0402","无效的用户输入"),
    CAPTCHA_CHECK_ERR("A0403","无效的用户输入"),

    //系统端
    //一级宏观错误码
    SYS_ERR("B0001", "系统执行出错"),
    //二级宏观错误
    SYS_TIMEOUT("B0100", "系统执行超时"),
    SYS_DR_TOUCH("B0100", "系统容灾功能被触发"),
    SYS_RESOURCE_EXP("B0100", "系统资源异常"),
    //三级宏观错误

    //第三方
    //一级宏观错误码
    THIRD_SERVER_ERR("C0001", "调用第三方服务出错"),
    //二级宏观错误
    MIDDLEWARE_ERR("C0100", "中间件服务出错"),
    THIRD_SERVER_TIMEOUT("C0200", "第三方系统执行超时"),
    MYSQL_DB_ERR("C0300", "数据库服务出错"),
    THIRD_DR_TOUCH("C0400", "第三方容灾系统被触发"),
    NOTIFY_SERVER_ERR("C0500", "通知服务出错"),
    //三级宏观错误


    ;


    private String code;
    private String msg;

    CommonResultCode(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }}